#include"chen.h"

typedef void Sigfunc( int );

static void sig_usr( int );

int main( )
{
	if ( Signal( SIGUSR1, sig_usr ) == SIG_ERR )	
		err_sys( "can't catch SIGUSR1" );
	if ( Signal( SIGUSR2, sig_usr ) == SIG_ERR )	
		err_sys( "can't catch SIGUSR2" );

	for ( ; ; )
		pause( );

	return 0;
}


static void sig_usr( int signo )
{
	if ( signo == SIGUSR1 )
		fprintf( stderr, "received SIGUSR1\n" );
	else if ( signo == SIGUSR2 )
		fprintf( stderr, "received SIGUSR2\n" );
	else
		fprintf( stderr, "nothing is received\n" );
}
